package hu.java2.model;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

public class User {

	private int id;
	private String name;
	private String password;
	private Date lastLogin;
	private Set<Category> categories;
	private String email;
	
	public Iterable<Goal> getGoals() {
		Set<Goal> goals = new HashSet<Goal>();
		for ( Category c : categories ) {
			goals.addAll(c.getGoals());
		}
		return goals;
	}

	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public Date getLastLogin() {
		return lastLogin;
	}
	public void setLastLogin(Date lastLogin) {
		this.lastLogin = lastLogin;
	}
	public Set<Category> getCategories() {
		return categories;
	}
	public void setCategories(Set<Category> categories) {
		this.categories = categories;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	
}
